<#-- @ftlvariable name="todoList" type="java.util.List<nxu.it.model.Todo>" -->
<!doctype html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="/static/styles/test.css">
    <title>代办</title>
    <style>
        .is-complete {
            text-decoration: line-through;
        }
    </style>
</head>
<body>
<form action="/todo/save" method="post">
    <div class="field">
        <label for="content">内容：</label>
        <input type="text" id="content" name="content" placeholder="请输入待办事项内容">
        <input type="submit" value="新建">
    </div>
</form>
<table>
    <tr>
        <th>ID</th>
        <th>Content</th>
        <th>Complete</th>
        <th>Actions</th>
    </tr>
    <#list todoList as todo>
        <tr>
            <td>${todo.id}</td>
            <td <#if todo.complete>class="is-complete"</#if>>${todo.content}</td>
            <td><input type="checkbox" ${todo.complete?string('checked', '')}></td>
            <td>
                <a href="/todo/check?id=${todo.id}">Check</a> |
                <a href="/todo/edit?id=${todo.id}">Edit</a> |
                <a href="/todo/delete?id=${todo.id}">Delete</a>
            </td>
        </tr>
    </#list>
</table>
</body>
</html>